﻿namespace Centido.Core.Test
{
    using Microsoft.VisualStudio.TestTools.UnitTesting;

    /// <summary>
    /// Testing big integer table column
    /// </summary>
    [TestClass]
    public class BigIntColumnTest : ColumnBaseTest<long?>
    {
        /// <summary>
        /// Get column type
        /// </summary>
        /// <returns></returns>
        protected override ColumnType GetColumnType()
        {
            return ColumnType.BigInteger;
        }

        /// <summary>
        /// Get large value
        /// </summary>
        /// <returns></returns>
        protected override long? GetLargeValue()
        {
            return 1223372036854775807;
        }

        /// <summary>
        /// Get small value
        /// </summary>
        /// <returns></returns>
        protected override long? GetSmallValue()
        {
            return -1223372036854775807;
        }

        /// <summary>
        /// Convert db value
        /// </summary>
        /// <param name="dbValue">Db value</param>
        /// <returns></returns>
        protected override long? ConvertDbValue(object dbValue)
        {
            return DbValue.GetBigInteger(dbValue);
        }
    }
}